//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.user;

import java.io.Serializable;

public class User
        implements Serializable {

    public User() {
    }

    public User(String id, String lastname, String firstname, String addrLn1, String addrLn2, String city, String zip,
            String tel1, String group, String notes, String tel2, String job, String msg, String expiryDate,
            Integer numConsult, Integer law, String password, String fax, String email, String updateLastTime, String userId,
            byte photo1[], byte photo2[]) {
        setId(id);
        setLastname(lastname);
        setFirstname(firstname);
        setAddrLn1(addrLn1);
        setAddrLn2(addrLn2);
        setCity(city);
        setZip(zip);
        setTel1(tel1);
        setGroup(group);
        setNotes(notes);
        setTel2(tel2);
        setJob(job);
        setMsg(msg);
        setExpiryDate(expiryDate);
        setNumConsult(numConsult);
        setLaw(law);
        setPassword(password);
        setFax(fax);
        setEmail(email);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
        setPhoto1(photo1);
        setPhoto2(photo2);
    }

    public User(User user) {
        setId(user.getId());
        setLastname(user.getLastname());
        setFirstname(user.getFirstname());
        setAddrLn1(user.getAddrLn1());
        setAddrLn2(user.getAddrLn2());
        setCity(user.getCity());
        setZip(user.getZip());
        setTel1(user.getTel1());
        setGroup(user.getGroup());
        setNotes(user.getNotes());
        setTel2(user.getTel2());
        setJob(user.getJob());
        setMsg(user.getMsg());
        setExpiryDate(user.getExpiryDate());
        setNumConsult(user.getNumConsult());
        setLaw(user.getLaw());
        setPassword(user.getPassword());
        setFax(user.getFax());
        setEmail(user.getEmail());
        setUpdateLastTime(user.getUpdateLastTime());
        setUserId(user.getUserId());
        setPhoto1(user.getPhoto1());
        setPhoto2(user.getPhoto2());
    }

    public String getId() {
        return id;
    }

    public String getLastname() {
        return lastname;
    }

    public String getFirstname() {
        return firstname;
    }

    public String getAddrLn1() {
        return addrLn1;
    }

    public String getAddrLn2() {
        return addrLn2;
    }

    public String getTel1() {
        return tel1;
    }

    public String getGroup() {
        return group;
    }

    public String getNotes() {
        return notes;
    }

    public Integer getLaw() {
        return law;
    }

    public String getPassword() {
        return password;
    }

    public String getFax() {
        return fax;
    }

    public String getEmail() {
        return email;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public void setAddrLn1(String addrLn1) {
        this.addrLn1 = addrLn1;
    }

    public void setAddrLn2(String addrLn2) {
        this.addrLn2 = addrLn2;
    }

    public void setTel1(String tel1) {
        this.tel1 = tel1;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public void setLaw(Integer law) {
        this.law = law;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getCity() {
        return city;
    }

    public String getTel2() {
        return tel2;
    }

    public Integer getNumConsult() {
        return numConsult;
    }

    public String getExpiryDate() {
        return expiryDate;
    }

    public String getMsg() {
        return msg;
    }

    public String getJob() {
        return job;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public void setTel2(String tel2) {
        this.tel2 = tel2;
    }

    public void setNumConsult(Integer numConsult) {
        this.numConsult = numConsult;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public byte[] getPhoto1() {
        return photo1;
    }

    public void setPhoto1(byte photo1[]) {
        this.photo1 = photo1;
    }

    public byte[] getPhoto2() {
        return photo2;
    }

    public void setPhoto2(byte photo2[]) {
        this.photo2 = photo2;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "lastname=" + getLastname() + " " + "firstname=" + getFirstname() + " " + "addrLn1=" + getAddrLn1() + " " + "addrLn2=" + getAddrLn2() + " " + "city=" + getCity() + " " + "zip=" + getZip() + " " + "tel1=" + getTel1() + " " + "group=" + getGroup() + " " + "notes=" + getNotes() + " " + "tel2=" + getTel2() + " " + "job=" + getJob() + " " + "msg=" + getMsg() + " " + "expiryDate=" + getExpiryDate() + " " + "numConsult=" + getNumConsult() + " " + "law=" + getLaw() + " " + "password=" + getPassword() + " " + "fax=" + getFax() + " " + "email=" + getEmail() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof User) {
            User lTest = (User) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (lastname == null) {
                lEquals = lEquals && lTest.lastname == null;
            } else {
                lEquals = lEquals && lastname.equals(lTest.lastname);
            }
            if (firstname == null) {
                lEquals = lEquals && lTest.firstname == null;
            } else {
                lEquals = lEquals && firstname.equals(lTest.firstname);
            }
            if (addrLn1 == null) {
                lEquals = lEquals && lTest.addrLn1 == null;
            } else {
                lEquals = lEquals && addrLn1.equals(lTest.addrLn1);
            }
            if (addrLn2 == null) {
                lEquals = lEquals && lTest.addrLn2 == null;
            } else {
                lEquals = lEquals && addrLn2.equals(lTest.addrLn2);
            }
            if (city == null) {
                lEquals = lEquals && lTest.city == null;
            } else {
                lEquals = lEquals && city.equals(lTest.city);
            }
            if (zip == null) {
                lEquals = lEquals && lTest.zip == null;
            } else {
                lEquals = lEquals && zip.equals(lTest.zip);
            }
            if (tel1 == null) {
                lEquals = lEquals && lTest.tel1 == null;
            } else {
                lEquals = lEquals && tel1.equals(lTest.tel1);
            }
            if (group == null) {
                lEquals = lEquals && lTest.group == null;
            } else {
                lEquals = lEquals && group.equals(lTest.group);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (tel2 == null) {
                lEquals = lEquals && lTest.tel2 == null;
            } else {
                lEquals = lEquals && tel2.equals(lTest.tel2);
            }
            if (job == null) {
                lEquals = lEquals && lTest.job == null;
            } else {
                lEquals = lEquals && job.equals(lTest.job);
            }
            if (msg == null) {
                lEquals = lEquals && lTest.msg == null;
            } else {
                lEquals = lEquals && msg.equals(lTest.msg);
            }
            if (law == null) {
                lEquals = lEquals && lTest.law == null;
            } else {
                lEquals = lEquals && law.equals(lTest.law);
            }
            if (password == null) {
                lEquals = lEquals && lTest.password == null;
            } else {
                lEquals = lEquals && password.equals(lTest.password);
            }
            if (fax == null) {
                lEquals = lEquals && lTest.fax == null;
            } else {
                lEquals = lEquals && fax.equals(lTest.fax);
            }
            if (email == null) {
                lEquals = lEquals && lTest.email == null;
            } else {
                lEquals = lEquals && email.equals(lTest.email);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (expiryDate == null) {
                lEquals = lEquals && lTest.expiryDate == null;
            } else {
                lEquals = lEquals && expiryDate.equals(lTest.expiryDate);
            }
            if (numConsult == null) {
                lEquals = lEquals && lTest.numConsult == null;
            } else {
                lEquals = lEquals && numConsult.equals(lTest.numConsult);
            }
            if (photo1 == null) {
                lEquals = lEquals && lTest.photo1 == null;
            } else {
                lEquals = lEquals && photo1.equals(lTest.photo1);
            }
            if (photo2 == null) {
                lEquals = lEquals && lTest.photo2 == null;
            } else {
                lEquals = lEquals && photo2.equals(lTest.photo2);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (lastname == null ? 0 : lastname.hashCode());
        result = 37 * result + (firstname == null ? 0 : firstname.hashCode());
        result = 37 * result + (addrLn1 == null ? 0 : addrLn1.hashCode());
        result = 37 * result + (addrLn2 == null ? 0 : addrLn2.hashCode());
        result = 37 * result + (city == null ? 0 : city.hashCode());
        result = 37 * result + (zip == null ? 0 : zip.hashCode());
        result = 37 * result + (tel1 == null ? 0 : tel1.hashCode());
        result = 37 * result + (group == null ? 0 : group.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (tel2 == null ? 0 : tel2.hashCode());
        result = 37 * result + (job == null ? 0 : job.hashCode());
        result = 37 * result + (msg == null ? 0 : msg.hashCode());
        result = 37 * result + (law == null ? 0 : law.hashCode());
        result = 37 * result + (password == null ? 0 : password.hashCode());
        result = 37 * result + (fax == null ? 0 : fax.hashCode());
        result = 37 * result + (email == null ? 0 : email.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (expiryDate == null ? 0 : expiryDate.hashCode());
        result = 37 * result + (numConsult == null ? 0 : numConsult.hashCode());
        result = 37 * result + (photo1 == null ? 0 : photo1.hashCode());
        result = 37 * result + (photo2 == null ? 0 : photo2.hashCode());
        return result;
    }
    private String id;
    private String lastname;
    private String firstname;
    private String addrLn1;
    private String addrLn2;
    private String city;
    private String zip;
    private String tel1;
    private String tel2;
    private String group;
    private String job;
    private String notes;
    private String msg;
    private String expiryDate;
    private Integer numConsult;
    private Integer law;
    private String password;
    private String fax;
    private String email;
    private String updateLastTime;
    private String userId;
    private byte photo1[];
    private byte photo2[];
}
